package com.linkage.jz.bankruptcy.activity.Main;

import android.app.ActionBar;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.StateListDrawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.linkage.jz.bankruptcy.R;
import com.linkage.jz.bankruptcy.activity.MainActivity;
import com.linkage.jz.bankruptcy.activity.Person.PersonSettingReadMeActivity;
import com.linkage.jz.bankruptcy.activity.RegistLogin.GetPwdOneActivity;
import com.linkage.jz.bankruptcy.activity.RegistLogin.PhoneLoginActivity;
import com.linkage.jz.bankruptcy.base.BaseActivity;
import com.linkage.jz.bankruptcy.fragment.Main.LawListFrgment;
import com.linkage.jz.bankruptcy.widget.ShapeLoadingDialog;

import java.util.ArrayList;
import java.util.List;


/**
 * A login screen that offers login via email/password.
 */
public  class ToolsActivity extends BaseActivity implements OnClickListener{
    private static final String TAG = PersonSettingReadMeActivity.class.getSimpleName();

    @Override
    public void initData() {

    }

    @Override
    public void setListener() {

        top_back.setOnClickListener(this);
        ll_lxcalc.setOnClickListener(this);
        ll_datecalc.setOnClickListener(this);
        ll_wyjcalc.setOnClickListener(this);
        ll_carryout.setOnClickListener(this);
    }

    @Override
    public void initTitle() {
        top_title = findViewById(R.id.top_title);
        top_title.setText("便捷工具");
        top_mune.setVisibility(View.INVISIBLE);

    }

    @Override
    public void initView() {

    }


    TextView top_title;
    Button top_back,top_mune;
    LinearLayout ll_lxcalc,ll_datecalc,ll_wyjcalc,ll_carryout;

    public static void start(Context context) {
        Intent intent = new Intent(context, ToolsActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        setContentView(R.layout.activity_main_tools);

        initview();

        super.onCreate(savedInstanceState);
    }

    //初始化视图
    private void initview() {
        //登录层、下拉层、其它登录方式层



        top_back = findViewById(R.id.top_back);
        top_mune = findViewById(R.id.top_mune);


        ll_lxcalc = findViewById(R.id.ll_lxcalc);
        ll_datecalc = findViewById(R.id.ll_datecalc);
        ll_wyjcalc = findViewById(R.id.ll_wyjcalc);
        ll_carryout = findViewById(R.id.ll_carryout);
        setupViews();


    }


    private ViewGroup mMoreLayout;
    private List<ImageView> views = new ArrayList<ImageView>();
    private void setupViews() {
//        setContentView(R.layout.activity_main);

    }



    @Override
    public void onClick(View v) {

        switch (v.getId()) {

            case R.id.top_back:
                finish();
                break;

            case R.id.ll_lxcalc:
                RateCalcActivity.start(this);
                break;
            case R.id.ll_datecalc:
                DateCalcActivity.start(this);
                break;
            case R.id.ll_wyjcalc:
                PenaltyCalcActivity.start(this);
                break;
            case R.id.ll_carryout:
                CarryOutListActivity.start(this);
                break;
            default:
                break;
        }

//        final Object tag = v.getTag();      //通过之前setTag找到点击位置
//        if (tag != null) {
//            String department = (String) tag;
//            if("1".equalsIgnoreCase(department))
//            {
//                RateCalcActivity.start(this);
//            }else if("2".equalsIgnoreCase(department))
//            {
//                DateCalcActivity.start(this);
//            }else if("3".equalsIgnoreCase(department))
//            {
//                PenaltyCalcActivity.start(this);
//            }else if("4".equalsIgnoreCase(department))
//            {
////                ToolsActivity.start(getActivity());
//                CarryOutListActivity.start(this);
//            }
//        } // else ignored
    }


}


